extends TextureRect
class_name Card
@onready var suit: TextureRect = $Suit
@onready var suit_2: TextureRect = $Suit2
@onready var label: Label = $Label
@onready var label_2: Label = $Label2




func set_suit(suit_index: int):
	if suit_index == 0:
		suit.texture = preload("res://core/puzzles/card_guess/spade.png")
		suit_2.texture = preload("res://core/puzzles/card_guess/spade.png")
	if suit_index == 1:
		suit.texture = preload("res://core/puzzles/card_guess/diamond.png")
		suit_2.texture = preload("res://core/puzzles/card_guess/diamond.png")
	if suit_index == 2:
		suit.texture = preload("res://core/puzzles/card_guess/club.png")
		suit_2.texture = preload("res://core/puzzles/card_guess/club.png")
	if suit_index == 3:
		suit.texture = preload("res://core/puzzles/card_guess/heart.png")
		suit_2.texture = preload("res://core/puzzles/card_guess/heart.png")


func set_label(num: int):
	var label_str: String = str(num)
	if num == 1:
		label_str = "A"
	if num == 11:
		label_str = "J"
	if num == 12:
		label_str = "Q"
	if num == 13:
		label_str = "K"
	label.text = label_str
	label_2.text = label_str
